import request from '@/utils/request'
/**
 *
 * 员工管理
 *
 **/
// 登录
export const login = (data: any) =>
  request({
    'url': '/employee/login',
    'method': 'post',
    data: data
  })

// 退出
export const userLogout = (params: any) =>
 request({
   'url': '/employee/logout',
   'method': 'post',
   params
 })

//获取员工分页查询结果
export const getEmployeeList = (params: any) =>
 request({
   'url': '/employee/page',
   'method': 'get',
   'params': params
 })

 //启用、禁用员工账号
export const enableOrDisableEmployee = (params: any) =>
 request({
   'url': `/employee/status/${params.status}`,
   'method': 'post',
   'params': {id: params.id}
 })

 //添加员工
 export const addEmployee = (params: any) =>
 request({
   'url': '/employee',
   'method': 'post',
   'data': params
 })

// 根据id查询员工
export const queryEmployeeById = (id: number) =>
request({
  'url': `/employee/${id}`,
  'method': 'GET'
})

// 修改员工
export const updateEmployee = (params: any) =>
request({
  'url': '/employee',
  'method': 'PUT',
  'data': params
})